package com.nuanshui.heatedloan.dao.cms.security;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import com.nuanshui.heatedloan.entity.cms.security.Organization;


public interface OrganizationDao extends JpaRepository<Organization, Long>,
		JpaSpecificationExecutor<Organization> {
	Page<Organization> findByParentId(Long parentId, Pageable pageable);

	Page<Organization> findByParentIdAndNameContaining(Long parentId,
			String name, Pageable pageable);

	@Query("from Organization")
	List<Organization> findAllWithCache();
}
